﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;



namespace LjServer
{
    //生成更新数据报告
    class InvalidationReport
    {
        public static  string  createReport()
        {
           
            //----------------------------------------//
            //----------生成基夫分布的随机数----------//
            //----------------------------------------//

            int width = 20;
            int seed = 1000;
            string[] array = new string[width];
            string report = "";
            Random random = new Random();
            invalidationData zipf = new invalidationData(seed, 1.0);
            invalidationData.SetRandomSeed(DateTime.Now.Second);//用系统时间做种子

            int x = 0;
            int count = 0;
            while (count < width)
            {
                string temp = zipf.Pick().ToString();//random.Next(100);
                if (array.Contains(temp) || array.Contains(temp + ","))
                {
                    count++;
                    continue;
                }
                report += (count == width - 1 ? temp : (temp + ","));
                array[x] = (x == width - 1 ? temp : (temp + ","));
                count++;
                x++;

            }
            report += "\n";
            return report;

        }
    }
}
